//
//  ClockViewEdit.m
//  iEasyTime
//
//  Created by User on 7/2/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "ClockViewEdit.h"


@implementation ClockViewEdit

@synthesize label;
@synthesize dateFormat;
@synthesize clockType;
@synthesize timeFormat;
@synthesize timeZone;

-(IBAction)save{
	
/*	NSString *temp = name.text;	
	if(temp.length == 0){
		name.text = @"Somebody";
	}
	
	NSString *summary = [[NSString alloc] initWithFormat: @"You are %@,  who is %@ and has $%@ dollars. Are you using a 24 hour clock? %@", name.text, (int)age.text, balance.text, clockType];
	label.text = summary;
	
	int myAge = (int)age.text;
	NSString *zone = timeZone;
	
	NSUserDefaults *clockOptions = [NSUserDefaults standardUserDefaults];
	[clockOptions setObject:zone forKey:@"Timezone"];
	[clockOptions setObject:temp forKey:@"DateFormat"];
	[clockOptions setInteger:myAge forKey:@"TimeFormat"];
*/	
}

-(BOOL)textFieldShouldReturn:(UITextField *)theTextField {
		[theTextField resignFirstResponder];
	return YES;
}

-(IBAction)clear:(id)sender{
	[dateFormat resignFirstResponder];
  	[timeFormat resignFirstResponder];
}


-(IBAction)clockSwitch{
	if(clockType == YES){ 
		clockType =NO;
	}else{
		clockType = YES;
	}
}

/*
 // The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
        // Custom initialization
    }
    return self;
}
*/

/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
}
*/

/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


- (void)dealloc {
	[label release];
	[dateFormat release];
	[timeFormat release];
	[timeZone release];
    [super dealloc];
}


@end
